package com.example.mytest.Entity;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by Studio on 2017/5/18.
 */
@Entity
@Table(name = "device", schema = "mytest", catalog = "")
public class DeviceEntity {
    private String id;
    private String name;
    private String aliasName;
    private String sn;
    private String mac;
    private String secretKey;
    private String productId;
    private String deviceIp;
    private Byte actived;
    private Timestamp activedAt;
    private Timestamp onlineAt;
    private Timestamp offlineAt;
    private String createdBy;
    private Timestamp createdAt;
    private Timestamp updateAt;
    private Byte locateMode;
    private Byte online;
    private String model;
    private String deviceGroup;
    private Integer guanzhu;
    private Integer bind;
    private String jx;
    private String zdyh;
    private String docFile;
    private String xcxlh;

    @Id
    @Column(name = "id")
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Basic
    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "alias_name")
    public String getAliasName() {
        return aliasName;
    }

    public void setAliasName(String aliasName) {
        this.aliasName = aliasName;
    }

    @Basic
    @Column(name = "sn")
    public String getSn() {
        return sn;
    }

    public void setSn(String sn) {
        this.sn = sn;
    }

    @Basic
    @Column(name = "mac")
    public String getMac() {
        return mac;
    }

    public void setMac(String mac) {
        this.mac = mac;
    }

    @Basic
    @Column(name = "secret_key")
    public String getSecretKey() {
        return secretKey;
    }

    public void setSecretKey(String secretKey) {
        this.secretKey = secretKey;
    }

    @Basic
    @Column(name = "product_id")
    public String getProductId() {
        return productId;
    }

    public void setProductId(String productId) {
        this.productId = productId;
    }

    @Basic
    @Column(name = "device_ip")
    public String getDeviceIp() {
        return deviceIp;
    }

    public void setDeviceIp(String deviceIp) {
        this.deviceIp = deviceIp;
    }

    @Basic
    @Column(name = "actived")
    public Byte getActived() {
        return actived;
    }

    public void setActived(Byte actived) {
        this.actived = actived;
    }

    @Basic
    @Column(name = "actived_at")
    public Timestamp getActivedAt() {
        return activedAt;
    }

    public void setActivedAt(Timestamp activedAt) {
        this.activedAt = activedAt;
    }

    @Basic
    @Column(name = "online_at")
    public Timestamp getOnlineAt() {
        return onlineAt;
    }

    public void setOnlineAt(Timestamp onlineAt) {
        this.onlineAt = onlineAt;
    }

    @Basic
    @Column(name = "offline_at")
    public Timestamp getOfflineAt() {
        return offlineAt;
    }

    public void setOfflineAt(Timestamp offlineAt) {
        this.offlineAt = offlineAt;
    }

    @Basic
    @Column(name = "created_by")
    public String getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }

    @Basic
    @Column(name = "created_at")
    public Timestamp getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Timestamp createdAt) {
        this.createdAt = createdAt;
    }

    @Basic
    @Column(name = "update_at")
    public Timestamp getUpdateAt() {
        return updateAt;
    }

    public void setUpdateAt(Timestamp updateAt) {
        this.updateAt = updateAt;
    }

    @Basic
    @Column(name = "locate_mode")
    public Byte getLocateMode() {
        return locateMode;
    }

    public void setLocateMode(Byte locateMode) {
        this.locateMode = locateMode;
    }

    @Basic
    @Column(name = "online")
    public Byte getOnline() {
        return online;
    }

    public void setOnline(Byte online) {
        this.online = online;
    }

    @Basic
    @Column(name = "model")
    public String getModel() {
        return model;
    }

    public void setModel(String model) {
        this.model = model;
    }

    @Basic
    @Column(name = "device_group")
    public String getDeviceGroup() {
        return deviceGroup;
    }

    public void setDeviceGroup(String deviceGroup) {
        this.deviceGroup = deviceGroup;
    }

    @Basic
    @Column(name = "guanzhu")
    public Integer getGuanzhu() {
        return guanzhu;
    }

    public void setGuanzhu(Integer guanzhu) {
        this.guanzhu = guanzhu;
    }

    @Basic
    @Column(name = "bind")
    public Integer getBind() {
        return bind;
    }

    public void setBind(Integer bind) {
        this.bind = bind;
    }

    @Basic
    @Column(name = "jx")
    public String getJx() {
        return jx;
    }

    public void setJx(String jx) {
        this.jx = jx;
    }

    @Basic
    @Column(name = "zdyh")
    public String getZdyh() {
        return zdyh;
    }

    public void setZdyh(String zdyh) {
        this.zdyh = zdyh;
    }

    @Basic
    @Column(name = "doc_file")
    public String getDocFile() {
        return docFile;
    }

    public void setDocFile(String docFile) {
        this.docFile = docFile;
    }

    @Basic
    @Column(name = "xcxlh")
    public String getXcxlh() {
        return xcxlh;
    }

    public void setXcxlh(String xcxlh) {
        this.xcxlh = xcxlh;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        DeviceEntity that = (DeviceEntity) o;

        if (id != null ? !id.equals(that.id) : that.id != null) return false;
        if (name != null ? !name.equals(that.name) : that.name != null) return false;
        if (aliasName != null ? !aliasName.equals(that.aliasName) : that.aliasName != null) return false;
        if (sn != null ? !sn.equals(that.sn) : that.sn != null) return false;
        if (mac != null ? !mac.equals(that.mac) : that.mac != null) return false;
        if (secretKey != null ? !secretKey.equals(that.secretKey) : that.secretKey != null) return false;
        if (productId != null ? !productId.equals(that.productId) : that.productId != null) return false;
        if (deviceIp != null ? !deviceIp.equals(that.deviceIp) : that.deviceIp != null) return false;
        if (actived != null ? !actived.equals(that.actived) : that.actived != null) return false;
        if (activedAt != null ? !activedAt.equals(that.activedAt) : that.activedAt != null) return false;
        if (onlineAt != null ? !onlineAt.equals(that.onlineAt) : that.onlineAt != null) return false;
        if (offlineAt != null ? !offlineAt.equals(that.offlineAt) : that.offlineAt != null) return false;
        if (createdBy != null ? !createdBy.equals(that.createdBy) : that.createdBy != null) return false;
        if (createdAt != null ? !createdAt.equals(that.createdAt) : that.createdAt != null) return false;
        if (updateAt != null ? !updateAt.equals(that.updateAt) : that.updateAt != null) return false;
        if (locateMode != null ? !locateMode.equals(that.locateMode) : that.locateMode != null) return false;
        if (online != null ? !online.equals(that.online) : that.online != null) return false;
        if (model != null ? !model.equals(that.model) : that.model != null) return false;
        if (deviceGroup != null ? !deviceGroup.equals(that.deviceGroup) : that.deviceGroup != null) return false;
        if (guanzhu != null ? !guanzhu.equals(that.guanzhu) : that.guanzhu != null) return false;
        if (bind != null ? !bind.equals(that.bind) : that.bind != null) return false;
        if (jx != null ? !jx.equals(that.jx) : that.jx != null) return false;
        if (zdyh != null ? !zdyh.equals(that.zdyh) : that.zdyh != null) return false;
        if (docFile != null ? !docFile.equals(that.docFile) : that.docFile != null) return false;
        if (xcxlh != null ? !xcxlh.equals(that.xcxlh) : that.xcxlh != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (aliasName != null ? aliasName.hashCode() : 0);
        result = 31 * result + (sn != null ? sn.hashCode() : 0);
        result = 31 * result + (mac != null ? mac.hashCode() : 0);
        result = 31 * result + (secretKey != null ? secretKey.hashCode() : 0);
        result = 31 * result + (productId != null ? productId.hashCode() : 0);
        result = 31 * result + (deviceIp != null ? deviceIp.hashCode() : 0);
        result = 31 * result + (actived != null ? actived.hashCode() : 0);
        result = 31 * result + (activedAt != null ? activedAt.hashCode() : 0);
        result = 31 * result + (onlineAt != null ? onlineAt.hashCode() : 0);
        result = 31 * result + (offlineAt != null ? offlineAt.hashCode() : 0);
        result = 31 * result + (createdBy != null ? createdBy.hashCode() : 0);
        result = 31 * result + (createdAt != null ? createdAt.hashCode() : 0);
        result = 31 * result + (updateAt != null ? updateAt.hashCode() : 0);
        result = 31 * result + (locateMode != null ? locateMode.hashCode() : 0);
        result = 31 * result + (online != null ? online.hashCode() : 0);
        result = 31 * result + (model != null ? model.hashCode() : 0);
        result = 31 * result + (deviceGroup != null ? deviceGroup.hashCode() : 0);
        result = 31 * result + (guanzhu != null ? guanzhu.hashCode() : 0);
        result = 31 * result + (bind != null ? bind.hashCode() : 0);
        result = 31 * result + (jx != null ? jx.hashCode() : 0);
        result = 31 * result + (zdyh != null ? zdyh.hashCode() : 0);
        result = 31 * result + (docFile != null ? docFile.hashCode() : 0);
        result = 31 * result + (xcxlh != null ? xcxlh.hashCode() : 0);
        return result;
    }
}
